package web.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import web.mapper.StudentMapper;
import web.pojo.Student;

@Service
public class StudentService {

    @Autowired
    StudentMapper mapper;

    public Student findStudentInfoById(Long id) {
        Student stu = mapper.findStudentInfoByUserId(id);
        return stu;
    }

    public boolean modifyStudentInfo(Integer sex, String birthday, String address, String note, String name,
            Long id) {

        try {
            mapper.updateStudentInfoById(sex, birthday, address, note, name, id);
            return true;
        } catch (Exception e) {
            System.out.println(e.getMessage());
            return false;
        }
    }
}
